package com.bjfu.controller;
import com.bjfu.dto.*;
import com.bjfu.model.Team;
import com.bjfu.model.User;
import com.bjfu.service.SuperManagerService;
import com.bjfu.service.TeamAdminService;
import com.bjfu.service.TeammemberService;
import com.bjfu.utils.JwtUtils;
import com.bjfu.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/Member")
public class TeammemberController {
    @Autowired
    private TeammemberService teammemberService;
    //根据成员id获取审核状态
    @GetMapping("/getStatus")
    public Result getStatus(@RequestParam Long user_id) {
        return teammemberService.getStatus(user_id);
    }


    // 用户更改个人信息接口
    @PostMapping("/updateInfo")
    public Result updateInfo(@RequestBody UpdateMemberInfo updateMemberInfo) {
        // 调用 service 层进行更改逻辑处理
        /*Long userId = JwtUtils.getUserId(token);
        System.out.println(userId);
        return teammemberService.updateInfo(userId,updateMemberInfo);*/
        System.out.println(updateMemberInfo);
        return teammemberService.updateInfo(updateMemberInfo);
    }
}
